home *** CD-ROM | disk | FTP | other *** search
/ Deutsche Edition 1 / Deutsche Edition 1.iso / amok / 051-060 / amok58 / crc / crc.mod < prev    next >
Text File  |  1993-11-04  |  3KB  |  86 lines

  1. (* ==================================================================== *)
  2. (* === crc.library ==================================================== *)
  3. (* ==================================================================== *)
  4. (*
  5.  
  6.   :Program.       CRC.MOD
  7.   :Contents.      interface module for the crc.library
  8.   :Author.        Peter Fröhlich [phf]
  9.   :Copyright.     Public Domain
  10.   :Language.      Oberon (revised)
  11.   :Translator.    Amiga Oberon V2.01
  12.   :History.       V0.2 [phf] 09-Sep-1991 [created]
  13.  
  14.   :Support.       -
  15.   :Imports.       -
  16.   :Bugs.          none known
  17.  
  18.   :Address.       Z-NET:P.FROEHLICH@NEXT-BOX.ZER
  19.  
  20. *)
  21. (* ==================================================================== *)
  22.  
  23. MODULE CRC;
  24.  
  25. (* ==================================================================== *)
  26. (* === Imports ======================================================== *)
  27. (* ==================================================================== *)
  28.  
  29. IMPORT
  30.     e : Exec,
  31.     i : Intuition,
  32.   sys : SYSTEM;
  33.  
  34. (* ==================================================================== *)
  35. (* === Variables ====================================================== *)
  36. (* ==================================================================== *)
  37.  
  38. VAR
  39.   crc * : e.LibraryPtr;
  40.  
  41. (* ==================================================================== *)
  42. (* === Procedures ===================================================== *)
  43. (* ==================================================================== *)
  44.  
  45. (*==== Interface to the crc.library ====================================*)
  46.  
  47. (*
  48.  
  49.  The following two procedures are not yet implemented... :-(
  50.  
  51. PROCEDURE UpdateCRC16 * {crc, -30} (oldCrc {0} : INTEGER;
  52.                                       byte {1} : BYTE) : INTEGER;
  53.  
  54. PROCEDURE CalcCRC16 * {crc, -36} (address {8} : e.ADDRESS;
  55.                                   initCRC {0} : INTEGER;
  56.                                      size {1} : INTEGER): INTEGER;
  57. *)
  58.  
  59.  
  60. PROCEDURE UpdateCRC32 * {crc, -42} (oldCrc {0} : LONGINT;
  61.                                       byte {1} : BYTE) : LONGINT;
  62.  
  63. PROCEDURE CalcCRC32 * {crc, -48} (address {8} : e.ADDRESS;
  64.                                   initCRC {0} : LONGINT;
  65.                                      size {1} : LONGINT): LONGINT;
  66.  
  67. (*==== Support procedures ==============================================*)
  68.  
  69. (* ==================================================================== *)
  70.  
  71. (* ==================================================================== *)
  72. (* === Initialise ===================================================== *)
  73. (* ==================================================================== *)
  74.  
  75. BEGIN (* CRC *)
  76.  crc := e.OpenLibrary("crc.library",0);
  77.  IF (crc = NIL) THEN
  78.    sys.SETREG(0, i.DisplayAlert(0,"\x00\x64\x14Missing crc.library !",50));
  79.    HALT(0);
  80.  END;
  81. CLOSE
  82.  IF (crc # NIL) THEN e.CloseLibrary(crc) END;
  83. END CRC.
  84.  
  85. (* ==================================================================== *)
  86.